<?php
$user =  Yii::app()->getSession()->get('LOGGED_USER');
?>
<?php if (!isset($user->id)): ?>
    <li class="social" rel="en" href="javascript:void();">
        <a  href="<?php echo Yii::app()->createAbsoluteUrl('site/fblogin'); ?>">Login</a>
    </li>
<?php else: ?>
    <li class="username dropdown">
        <img src="https://graph.facebook.com/<?php echo $user->oauth_uid; ?>/picture?width=32&height=32"/>
        <p class="dropdown-toggle" data-toggle="dropdown">
            <?php echo $user->first_name; ?>
            <b class="caret fb-dropdown"></b>
        </p>
        <ul class="dropdown-menu">
            <li class="fb-logout" rel="en" href="javascript:void();">
                <a class="" href="<?php echo Yii::app()->createAbsoluteUrl('site/logout'); ?>">Logout</a>
            </li>
        </ul>
    </li>
<?php endif; ?>
<li class="country select-lang" rel="vi" href="javascript:void();"><a class="current" href="#">VN</a></li>
<li class="country select-lang" rel="en" href="javascript:void();"><a class="" href="">EN</a></li>